<template>
	<h3>AAA</h3>
	<div>父组件传过来的：{{ aaa }}</div>
	<button @click="aaaEmit">子组件中点击修改 {{ aaa }}---{{ccc}}</button>
	<div @click="ddd">{{ ccc }}</div>
</template>

<script setup lang="ts">
import { ref, reactive, getCurrentInstance } from 'vue'
	let { proxy: _this } = <any>getCurrentInstance();
	// eslint-disable-next-line no-undef
	const props = defineProps({
		aaa: {
			type: Number,
			default: 0
		}
	})
	
	let ccc = ref(44444)

	// eslint-disable-next-line no-undef
	let emit = defineEmits(['aaa_emit_change'])
	function aaaEmit(){
		ccc.value++
		console.log('ccc', ccc.value);
		let a = props.aaa+1
		emit('aaa_emit_change', a)
	}
	
	function ddd(){
		console.log(_this.ccc, ccc);
	}

	// 子组件抛出数据
	let a = ref('aaaa')
	let b = reactive({
		b1: 'b111111',
		b2: 'b111111'
	})
	// eslint-disable-next-line no-undef
	defineExpose({a, b})
</script>

<style>
</style>
